package edu.zut.bailan.admin.domain;
import java.util.Set;

import javax.persistence.*;

import edu.zut.bailan.base.domain.BaseTreeEntity;

@Table(name = "T_ADMIN_GROUP")
@Entity
///@NamedQueries({ @NamedQuery(name = "Group.getRoot", query = "select g from Group g where g.parent is null") })
public class  Group extends BaseTreeEntity<Group, Long> {
    private static final long serialVersionUID = -1751952224371998469L;
    @Id
    @Column(name = "id", nullable = false)
    private Long id;

    @Column(name = "NAME")
    String name;

    @OneToMany(mappedBy = "group", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
    Set<User> users;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}